/**
 * Created with IntelliJ IDEA.
 * User: ajhin
 * Date: 10/1/13
 * Time: 5:53 PM
 * To change this template use File | Settings | File Templates.
 */
package com.societyGames.unitTestExercises
{
import com.societyGames.action.DelayAction;
import com.societyGames.codeExercise.CodeExercise;

public class UnitTestCodeExercise extends CodeExercise
{
  private var _isSuccessful:Boolean = false;

  public function setSuccess(isSuccessful:Boolean):void
  {
    _isSuccessful = isSuccessful;
  }

  public function delay(milliseconds:int):void
  {
    this._actionQueue.add(new DelayAction(milliseconds));
  }

  protected override function evaluateWithExceptionsHandled():void
  {
    if (_isSuccessful)
    {
      reportSuccess();
    }
    else
    {
      reportFailure();
    }
  }
}
}
